Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TaskConfig: Add option for file_limit to set RLIMIT_NOFILE #180

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sundbry
Copy link

@sundbry sundbry commented May 11, 2024

Depending on the workload, the default resource limit (ulimit) for the max number of file descriptors per process may need to be raised, such as for database servers. Add a file_limit option to the task config which will allow the limit to be set per task.

@@ -342,6 +380,7 @@ func (d *Driver) createContainer(containerConfig *ContainerConfig, config *TaskC
containerd.WithRuntime(d.config.ContainerdRuntime, nil),
containerd.WithNewSnapshot(containerConfig.ContainerSnapshotName, containerConfig.Image),
containerd.WithNewSpec(opts...),
withFileLimit(uint64(config.FileLimit)),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of unmarshalling just-built spec back, I'd suggest setting rlimit by appending your function to opts

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing that out, I had to read a load of source code to find the right knobs to twist for this and that was something I missed. New revision just pushed up and verified in my test system!

@sundbry sundbry force-pushed the file-limit branch 2 times, most recently from eea3c06 to eb2daff Compare May 11, 2024 09:08
@sundbry sundbry requested a review from slonopotamus May 11, 2024 09:23
Depending on the workload, the default resource limit (ulimit) for the
max number of file descriptors per process may need to be raised, such
as for database servers. Add a `file_limit` option to the task config
which will allow the limit to be set per task.

Signed-off-by: Ryan Sundberg <[email protected]>
@sundbry
Copy link
Author

sundbry commented Sep 5, 2024

@slonopotamus Please re-approve when you get a chance, I had to rebase the branch. Thanks!

Copy link

github-actions bot commented Sep 5, 2024

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@sundbry sundbry requested a review from slonopotamus September 5, 2024 19:44
@sundbry
Copy link
Author

sundbry commented Sep 5, 2024

I have read the CLA Document and I hereby sign the CLA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants